import { ProCard, ProColumns, ProTable } from "@ant-design/pro-components";

const App:React.FC=()=>{

    interface DataType{
        date:string,depname:string,banchi:string,code:string,name:string,
        production:number,wages:number,
    };

    const columns:ProColumns<DataType>[]=[
        {dataIndex:'date',title:'日期'},{dataIndex:'depname',title:'部门'},{dataIndex:'banchi',title:'班次'},
        {dataIndex:'code',title:'工号',},{dataIndex:'name',title:'姓名'},{dataIndex:'production',title:'产量'},
        {dataIndex:'wages',title:'计件工资额'}
    ];

    const tdata:DataType[]=[
        {date:'2025-02-01',depname:'包装',banchi:'常班',code:'B11001',name:'王小丽',production:810,wages:136.5},
        {date:'2025-02-01',depname:'包装',banchi:'常班',code:'B11002',name:'李平',production:620,wages:168},
        {date:'2025-02-01',depname:'包装',banchi:'常班',code:'B11003',name:'刘红伟',production:450,wages:112},
        {date:'2025-02-01',depname:'包装',banchi:'常班',code:'B11004',name:'吴丹',production:320,wages:95.5},
    ];

    interface DataType2{
        ordercode:string,code:string,name:string,invstd:string,invstd2:string,munit:string,
        production:number,pricerate_item:string,price:number,total:number,
    }

    const columns2:ProColumns<DataType2>[]=[
        {dataIndex:'ordercode',title:'订单号',},{dataIndex:'code',title:'SKU码'},{dataIndex:'name',title:'产品名称'},
        {dataIndex:'invstd',title:'包装规格'},{dataIndex:'invstd2',title:'型号'},{dataIndex:'munit',title:'计量单位'},
        {dataIndex:'production',title:'产量'},{dataIndex:'pricerate_item',title:'计件项'},
        {dataIndex:'price',title:'单价'},{dataIndex:'total',title:'计件金额'},
    ];

    const tdata2:DataType2[]=[
        {ordercode:'D202501003',code:'J20234520',name:'超亮挂钻',invstd:'20*26加厚加长',invstd2:'',
            munit:'条',pricerate_item:'小袋1+中袋2',price:0.22,total:89.5,production:420,},
            {ordercode:'D202501003',code:'J20234520',name:'超亮挂钻',invstd:'20*26加厚加长',invstd2:'',
                munit:'条',pricerate_item:'小袋2+中袋4',price:0.30,total:27,production:90},
                {ordercode:'K202302',code:'J20234520',name:'超亮挂钻',invstd:'20*26加厚加长',invstd2:'',
                    munit:'条',pricerate_item:'小袋1+中袋2',price:0.25,total:20,production:200,},
                    {ordercode:'C205255',code:'V236225',name:'水晶象',invstd:'30*6',invstd2:'透明+红丝带',
                        munit:'条',pricerate_item:'中袋2+大箱',price:0.11,total:11,production:100,},
    ];

    return <>
        <ProCard title='计件工资汇总'>
            <ProTable<DataType>
                columns={columns}
                dataSource={tdata}
                search={false}
                rowSelection={{type:'radio'}}
                />
        </ProCard>
        <ProCard  title='计件工资明细'>
           <ProTable<DataType2>
               columns={columns2}
               dataSource={tdata2}
               search={false}
               rowSelection={{
                type:'checkbox'
               }}
            />
        
        </ProCard>
    </>;
};

export default App;